{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "25e1073f",
   "metadata": {},
   "source": [
    "<h1 align=\"center\"><b>中南民族大学软件能力培养试卷</b></h1>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a6f3d879",
   "metadata": {},
   "source": [
    "<b>考试要求</b>\n",
    "1. 考试时间120分钟，开始考试1小时后可以交卷离开。学生答案需答在指定位置，单项选择及问答题除了在试卷中填写，还要在文件提交连接中书写。\n",
    "2. 在考场内须保持安静，不准吸烟，不准喧哗，不准交头接耳、左顾右盼、打手势、做暗号，不准夹带、旁窥、抄袭或有意让他人抄袭，不准传抄答案或交换试卷。\n",
    "3. 试卷及试题等问题，考生须先举手，经监考员同意后轻声提问。涉及试题内容的疑问，不得向监考员询问。\n",
    "\n",
    "<b>试题说明</b>\n",
    "\n",
    "本次考试共四种题型，分别是\n",
    "\n",
    "| 题型 | 数量 | 分值 | 总分 |\n",
    "| --- | --- | --- | --- |\n",
    "| 单项选择题 | 10 | 2 | 20 |\n",
    "| 判断题 |  10 | 2 | 20 |\n",
    "| 简答题 |  5 | 4 | 20 |\n",
    "| 操作题 | 4 | 10 | 40 |"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1f812b8",
   "metadata": {},
   "source": [
    "# 答案填写处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e468e42d",
   "metadata": {},
   "source": [
    "| 题型|填写示例| 题目1 | 题目2 | 题目3 | 题目4 | 题目5 | 题目6 | 题目7 | 题目8 | 题目9 | 题目10 |\n",
    "| --- |--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n",
    "| 单项选择题|A| 答案1-1 | 答案1-2 | 答案1-3 | 答案1-4 | 答案1-5 | 答案1-6 | 答案1-7 | 答案1-8 | 答案1-9 | 答案1-10 |\n",
    "| 判断题 |× |答案2-1 | 答案2-2 | 答案2-3 | 答案2-4 | 答案2-5 | 答案2-6 | 答案2-7 | 答案2-8|  答案2-9|  答案2-10|"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "428752c5",
   "metadata": {},
   "source": [
    "https://send2me.cn/Gxe26v7R/RKaAhjPTPWzueA"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6911e8db",
   "metadata": {},
   "source": [
    "# 单项选择题"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e306837",
   "metadata": {},
   "source": [
    "1. 下面哪个不是Python的保留字？ \n",
    "\n",
    "A. and B. or C. not D. then\n",
    "\n",
    "2. 下面哪个不是Python的内置函数？\n",
    "\n",
    "A. print() B. input() C. len() D. read()\n",
    "\n",
    "3. 下面哪个不是Python的数据类型？\n",
    "\n",
    "A. int B. float C. char D. str\n",
    "\n",
    "4. 下面哪个函数可以用于创建一个全是0的数组？ \n",
    "\n",
    "A. np.ones() B. np.zeros() C. np.random.rand() D. np.arange()\n",
    "\n",
    "5. 下面哪个函数可以用于读取csv文件？ \n",
    "\n",
    "A. pd.read_csv() B. pd.read_excel() C. pd.read_json() D. pd.read_html()\n",
    "\n",
    "\n",
    "6. 下面哪个函数可以用于查看DataFrame的前几行？\n",
    "\n",
    "A.df.info()  B. df.tail() C. df.head() D. df.describe()\n",
    "\n",
    "\n",
    "7. 下面哪个函数可以用于对DataFrame进行排序？\n",
    "\n",
    "A. df.sort_values() B. df.dropna() C. df.fillna() D. df.groupby()\n",
    "\n",
    "8. 下面哪个函数可以用于绘制折线图？ \n",
    "\n",
    "A.plt.bar() B. plt.scatter() C.plt.plot() D. plt.hist()\n",
    "\n",
    "\n",
    "9. 下面哪个函数可以用于设置图表的标题？\n",
    "\n",
    "A. plt.title() B. plt.xlabel() C. plt.ylabel() D. plt.legend()\n",
    "\n",
    "\n",
    "10. 下面哪个函数可以用于保存图表？\n",
    "\n",
    "A. plt.show() B. plt.savefig() C. plt.close() D. plt.grid()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fb0bc7cf",
   "metadata": {},
   "source": [
    "# 判断题"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cf466396",
   "metadata": {},
   "source": [
    "1.\tPython可以利用|求集合的交集。 \n",
    "\n",
    "2.\tPython中定义的函数名可以包含空格。 \n",
    "\n",
    "3.\tNumpy中的数组可以包含不同类型的数据。 \n",
    "\n",
    "4.\tPandas中的Series对象可以看作是一个带标签的一维数组。 \n",
    "\n",
    "5.\tPandas中的DataFrame对象可以看作是一个带标签的二维数组。 \n",
    "\n",
    "6.\tMatplotlib绘图时导入包后就可以直接使用中文命名标题。\n",
    "\n",
    "7.\tMatplotlib的一个画布上只能绘制一个图形。 \n",
    "\n",
    "8.\tPython中的if语句可以嵌套使用。\n",
    "\n",
    "9.\tPython中的for循环只能遍历列表和元组。\n",
    "\n",
    "10.\tPython中的while循环必须要有循环变量。 "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d63aa1a2",
   "metadata": {},
   "source": [
    "# 简答题\n",
    "+ 简答题应回答在指定位置，不得新创建单元格"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac3574f7",
   "metadata": {},
   "source": [
    "<b>第一题</b>\n",
    "\n",
    "定义一个函数，输入三边长度后能够判断三边是否能够构成三角形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "2425a685",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第一题作答处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6fc55dab",
   "metadata": {},
   "source": [
    "<b>第二题</b>\n",
    "\n",
    "构建一个4*4的数组，要求数组中有一半数据是0-1之间的浮点数，一半数据是1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "c2dbf069",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第二题作答处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5bf540d",
   "metadata": {},
   "source": [
    "<b>第三题</b>\n",
    "\n",
    "请将给的DateFrame的缺失值用5进行填充，然后删除重复行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "be127f3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第三题作答处\n",
    "df = pd.DataFrame({\n",
    "    'A': [9, 6, 5, np.nan, 5],\n",
    "    'B': [7, 2, np.nan, np.nan, 5],\n",
    "    'C': [6, 1, 4, 5, 5],\n",
    "    'D': [3, 8, 3, 5, 5]\n",
    "})"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fe51b94f",
   "metadata": {},
   "source": [
    "<b>第四题</b>\n",
    "\n",
    "请根据上题处理后的数据的第3列绘制一个柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "efdd4596",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第四题作答处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f92f126e",
   "metadata": {},
   "source": [
    "<b>第五题</b>\n",
    "\n",
    "请计算中南民族大学更名到现在的月数（每月按30天计算）。\n",
    "\n",
    "*中南民族大学创立于1951年，2002年3月正式更名为中南民族大学*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "00b2f322",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第五题作答处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c2162cc",
   "metadata": {},
   "source": [
    "# 操作题\n",
    "\n",
    "+ 可根据需求自己创建单元格"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8baa9957",
   "metadata": {},
   "source": [
    "<b>第一题</b>\n",
    "\n",
    "定义一个函数，输入任意数字列表即可识别列表中数字的大小关系并返回排序\n",
    "\n",
    "<b>示例</b>\n",
    "\n",
    "输入:[2,5,1,9]\n",
    "\n",
    "返回:\"9>5>2>1\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "132a75ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第一题作答处\n",
    "testlist=[2,5,1,9]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "66a5d0ef",
   "metadata": {},
   "source": [
    "<b>第二题</b>\n",
    "\n",
    "1. 将下列数据用DataFrame来存储，并分别命名为data1, data2, data3\n",
    "\n",
    "2. 请讲data1,data2按照'subject_id'的值进行合并\n",
    "\n",
    "3. 请将合并后的数据存储为“学生成绩.xlsx”文件，文件中不得保留行索引\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "88567dac",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第二题作答处\n",
    "raw_data_1 = {\n",
    "        'subject_id': ['1', '2', '3', '4', '5','6'],\n",
    "        'first_name': ['Alex', 'Amy', 'Allen', 'Alice', 'Ayoung','Jack'], \n",
    "        'last_name': ['Anderson', 'Ackerman', 'Ali', 'Aoni', 'Atiches','Potter']}\n",
    "raw_data_2 = {\n",
    "        'subject_id': ['4', '5', '6', '7', '8','9'],\n",
    "        'English': [23,67,23,47,82,37,92], \n",
    "        'math': [43,67,84,78,94,58,94]}\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "197f8c4c",
   "metadata": {},
   "source": [
    "<b>第三题</b>\n",
    "\n",
    "请在创建一个画布，画布上有1*3个子图，分别是区间[-5,5]上的一次函数图像、二次函数图像、三次函数图像"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "901f9299",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第三题作答处"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "821e38e7",
   "metadata": {},
   "source": [
    "<b>第四题</b>\n",
    "\n",
    "*tsv参考csv的读法*\n",
    "\n",
    "探索Chipotle快餐数据，读取数据chipotle.tsv，并将数据集存入一个名为chipo的数据框内¶\n",
    "\n",
    "1. 将数据集存入一个名为chipo的数据框内\n",
    "2. 被下单数最少商品(item)是什么?\n",
    "3. 一共有多少商品被下单？\n",
    "4. 绘制本文件中所有商品的销量饼状图\n",
    "5. 给饼状图添加标题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "e03e07a3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 第四题作答处\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
